#pragma once

#include "types.h"
#include <opencv2/opencv.hpp>

static std::vector<std::string> class_names = 
            { "person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic light",
            "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse", "sheep", "cow",
            "elephant", "bear", "zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee",
            "skis", "snowboard", "sports ball", "kite", "baseball bat", "baseball glove", "skateboard", "surfboard",
            "tennis racket", "bottle", "wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple",
            "sandwich", "orange", "broccoli", "carrot", "hot dog", "pizza", "donut", "cake", "chair", "couch",
            "potted plant", "bed", "dining table", "toilet", "tv", "laptop", "mouse", "remote", "keyboard", "cell phone",
            "microwave", "oven", "toaster", "sink", "refrigerator", "book", "clock", "vase", "scissors", "teddy bear",
            "hair drier", "toothbrush" };


static std::unordered_map<int, std::string> select_names = 
            {{0, "person"}, {1, "bicycle"}, {2, "car"},
            {3, "motorcycle"} , {5, "bus"}, {7, "truck"}, {9, "traffic light"},
            {15, "cat"}, {16, "dog"},{ 39, "bottle"}, {62, "tv"}
            };

cv::Rect get_rect(cv::Mat& img, float bbox[4]);

void nms(std::vector<Detection>& res, float *output, float conf_thresh, float nms_thresh = 0.5);

void draw_bbox(cv::Mat& img, std::vector<Detection>& res);

std::vector<cv::Mat> process_mask(const float* proto, int proto_size, std::vector<Detection>& dets);
